﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Sockets; 

namespace TCPClient
{
    class Receiver : OwningTcpClient, IReceive
    {
        public Receiver(TcpClient c):  base(c)
        {
        }

        public String receive()
        {
            NetworkStream ns = getClient().GetStream();

            byte[] bytes = new byte[getClient().ReceiveBufferSize];
            ns.Read(bytes, 0, bytes.Length);
            return Encoding.ASCII.GetString(bytes);
        }

    }
}
